package DesignPatern.A08_调停者模式.A002_调停者模式解决;

/**
 * @Author: Du
 * @Date: 2021/7/23 9:14
 */
public class Stock extends AbstractColleague
{
    public Stock(AbstractMediator mediator)
    {
        super(mediator);
    }
    
    private static int COMPUTER_NUMBER = 100;
    
    public void increase(int number)
    {
        COMPUTER_NUMBER += number;
        System.out.println("货存数量：" + COMPUTER_NUMBER);
    }
    
    public void decrease(int number)
    {
        COMPUTER_NUMBER -= number;
        System.out.println("剩余货存数量：" + COMPUTER_NUMBER);
    }
    
    public void clearStock()
    {
        System.out.println("清仓处理货物数量：" + COMPUTER_NUMBER);
        super.mediator.execute("stock");
    }
    
    public void getNumber()
    {
        super.mediator.execute("query");
    }
    
    public int getComputerNumber()
    {
        return COMPUTER_NUMBER;
    }
    
}
